<?php
 
 class Blog_Model_Index extends Zend_Db_Table
 {
 	protected $_name="album";
    protected $_primary = 'id';
    
 	public function insertAlbum($arrParam = null, $option = null)
  	{	  		  		
  		$row = $this->fetchNew();		  	
		$row->name       = @$arrParam['name'];
		$row->userid           =@$arrParam['userid'];			
		$row->createdate       =@$arrParam['createdate'];		
	  	return $row->save();
	  	
  	}
 	public function listItem($arrParam = null, $option = null){
		
		$db = Zend_Registry::get('connectDB');
		$pagesize = $arrParam['pagesize'];	
  		$offset = ($arrParam['page'] - 1) * $pagesize;		
  		$sql = "select * from post where (userid = '".$arrParam['userid']."' or user_wall_id = '".$arrParam['userid']."') and status = '".$arrParam['status']."' order by id DESC limit ".$offset.",".$pagesize." ";
  		$result = $db->fetchAll($sql);
		
  		return $result;
  	}
 }